﻿/*
 * Copyright (C) 2012, Jesus Requejo <jesus.requejo@gmail.com> 
 * Licensed under Microsoft Public License (Ms-PL)
 * http://www.microsoft.com/en-us/openness/licenses.aspx#MPL
*/

namespace Uninstaller {

   using System;
   using System.Diagnostics;
   using System.IO;
   using System.Windows.Forms;

   static class Program {
      [STAThread]
      static void Main() {;
         string guid = Infrastructure.RegistryManager.ReadProductCode();
         string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
         string msiexec = Path.Combine(path, "msiexec.exe");
         string arguments = string.Format("{0} {1}", "/qb /x", guid) ;         

         ProcessStartInfo uninstallProcess = new ProcessStartInfo(msiexec, arguments);
         Process.Start(uninstallProcess);
         Application.Exit();
      }
   }
}
